package br.com.estevam.sisfin.daos;

import org.apache.tapestry5.hibernate.HibernateSessionManager;
import org.apache.tapestry5.services.ApplicationStateManager;
import org.hibernate.Criteria;

import br.com.estevam.sisfin.daos.interfaces.CepDAO;
import br.com.estevam.sisfin.entities.Cep;

public class CepDAOImpl extends AbstractDAOImpl implements CepDAO {

	public CepDAOImpl(HibernateSessionManager hsm, ApplicationStateManager asm) {
		super(hsm, asm, Cep.class);
	}

	public Cep findByCep(int cep) {
		Criteria c = createCriteria();
		c = addEqRestriction(c, "cep", cep);
		return (Cep) c.uniqueResult();
	}

}
